#include <stdlib.h>
#include <string.h>
#include <stdio.h>

#include "air32f10x.h"

#include "system_air32f103.h"
#include "uart.h"
#include "gpio.h"


int main(void)
{	
	RCC_ClocksTypeDef clocks;

	RCC_ClkConfiguration();		//配置时钟 延迟函数初始化
	UART_Configuration(115200); //串口初始化

	RCC_GetClocksFreq(&clocks); //获取系统时钟频率
	printf("SYSCLK: %3.1fMhz, HCLK: %3.1fMhz, PCLK1: %3.1fMhz, PCLK2: %3.1fMhz, ADCCLK: %3.1fMhz\n",
			   (float)clocks.SYSCLK_Frequency / 1000000, (float)clocks.HCLK_Frequency / 1000000,
			   (float)clocks.PCLK1_Frequency / 1000000, (float)clocks.PCLK2_Frequency / 1000000, (float)clocks.ADCCLK_Frequency / 1000000);	

	
	MCO_GpioConfig();					 // MCO GPIO配置
	RCC_MCOConfig(RCC_MCO_SYSCLK); // MCO配置，支持输出 PLL 2-16 分频输出为增强功能

	while (1)
	{
		Delay_S(1);
		printf("1S----------\n");
	}
}



